<template>
  <div>
    <div class="toptit">
      <span class="addqs">说明：目前支持学科和关键字条件筛选</span>
      <div class="addbtn">
        <el-button type="success" size="small" @click="addqs"><i class="el-icon-edit" /><span>新增试题</span></el-button>
      </div>
    </div>
    <!-- 表单 选/输入框 -->
    <el-form :inline="true" :model="form" prop="region" size="small" label-width="80px">
      <div class="row">
        <el-row>
          <el-form-item label="学科">
            <div class="col">
              <el-select v-model="form.subject" placeholder="请选择" style="width:269px">
                <el-option
                  v-for="item in subjectsname"
                  :key="item.value"
                  :value="item.value"
                  :label="item.label"
                />
              </el-select></div>
          </el-form-item>
          <el-form-item label="二级目录">
            <el-select v-model="form.secleveldirel" placeholder="请选择" style="width:269px">
              <el-option
                v-for="item in secleveldire"
                :key="item.value"
                :value="item.value"
                :label="item.label"
              />
            </el-select>
          </el-form-item>
          <el-form-item label="标签">
            <el-select v-model="form.region" placeholder="请选择" style="width:269px">
              <el-option label="无数据" value="shanghai" />
            </el-select>
          </el-form-item>
          <el-form-item label="关键字">
            <el-input v-model="form.keyword" placeholder="请输入" style="width:269px" />
          </el-form-item>
        </el-row>
      </div>
      <el-row>
        <el-form-item label="试题类型">
          <el-select v-model="form.qstypel" placeholder="请选择" style="width:269px">
            <el-option
              v-for="item in qstype"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="难度">
          <el-select v-model="form.difficultyl" placeholder="请选择" style="width:269px">
            <el-option
              v-for="item in difficulty"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="方向">
          <el-select v-model="form.directionl" placeholder="请选择" style="width:269px">
            <el-option
              v-for="item in direction"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="录入人">
          <el-select v-model="form.staffl" placeholder="请选择" style="width:269px">
            <el-option
              v-for="item in staff"
              :key="item.id"
              :label="item.username"
              :value="item.username"
            />
          </el-select>
        </el-form-item>
      </el-row>
      <el-row>
        <el-form-item label="题目备注">
          <el-input v-model="form.remark" placeholder="请输入" style="width:269px" />
        </el-form-item>
        <el-form-item label="企业简称">
          <el-input v-model="form.abbreviation" placeholder="请输入" style="width:269px" />
        </el-form-item>
        <el-form-item label="城市">
          <el-select v-model="form.getCity" placeholder="请选择" style="width:131px" class="sel1">
            <el-option
              v-for="item in province"
              :key="item.id"
              :label="item.province"
              :value="item.province"
            />
          </el-select>
          <el-select v-model="form.getCity2" placeholder="请选择" style="width:134px">
            <el-option
              v-for="item in province"
              :key="item.id"
              :label="item.city"
              :value="item.city"
            />
          </el-select>
        </el-form-item>
        <div class="rigbtn">
          <el-button size="small" @click="clearbtn">清除</el-button>
          <el-button type="primary" size="small" @click="searchbtn">搜索</el-button>
        </div>
      </el-row>
    </el-form>
  </div>
</template>

<script>
import { directorys } from '@/api/question'
  export default {
    data() {
      return {
        form: {
          subject: '',
          qstypel: '',
          secleveldirel: '',
          difficultyl: '',
          directionl: '',
          staffl: '',
          abbreviation: '',
          remark: '',
          getCity: '',
          getCity2: '',
          subjectsName: '',
          region: '',
          keyword: ''
      }
      }
    },
    created() {
      this.directorys()
    },
    methods: {

      clearbtn() {
        // console.log(this.form);
        this.form = {}
      },
      searchbtn() {
        console.log(this.form)
      },
      // 获取目录
      async directorys() {
       const res = await directorys()
       console.log(res, '获取目录')
      }
    }
  }

</script>

<style lang="scss" scoped>

</style>